﻿using Prism.Mvvm;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AIVision.Model.InspectModels
{
    public class SampleDataModel: BindableBase
    {
        private string code;
        private int location;

        public int Location { get => location; set { location = value; RaisePropertyChanged(); } }
        private int startLocation;

        public int StartLocation { get => startLocation; set { startLocation = value; RaisePropertyChanged(); } }
        public string Code { get => code; set { code = value; RaisePropertyChanged(); } } 
        public Dictionary<int, InspectResultModel> InspectUnitResults { get; set; }
        //public List<HObject> SourceImages { get; set; }
        //public List<HObject> ShowImages { get; set; }
        public int InspectQty { get { return InspectUnitResults.Count; } }
        public int ScoreTotal { get { return InspectUnitResults.Sum(m => m.Value.Score); } }
        public string DefectNames
        {
            get
            {
                string defects = "";
                foreach (var ir in InspectUnitResults)
                {
                    defects += ir.Value.DefectNameSummary;
                }
                return defects;
            }
        }
    }
}
